package com.flute.framework.search;

import java.io.IOException;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.PrefixQuery;
import org.apache.lucene.search.Searcher;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.Weight;

public class FlutePrefixQuery extends PrefixQuery {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4442871332532847741L;

	public FlutePrefixQuery(Term prefix) {
		super(prefix);
	}

	@Override
	public Weight createWeight(Searcher searcher) throws IOException {
		TermQuery tq = new TermQuery(super.getPrefix());
		tq.setBoost(getBoost());

		return new LayerWeight(tq);
	}
}
